﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Facebook.Schema;
using ZFCNew.ZfcServiceReference;

namespace ZFCNew.Code
{
    public static class Utility
    {
        public static bool IsSimilarUrl(string tag, string url)
        {
            int slashIndex = tag.IndexOf("/");
            if (slashIndex > -1)
            {
                tag = tag.Remove(slashIndex);
            }

            slashIndex = url.IndexOf("/");
            if (slashIndex > -1)
            {
                url = url.Remove(slashIndex);
            }

            return string.Equals(tag, url, StringComparison.InvariantCultureIgnoreCase);

        }

        public static UserInfo ConvertToDbUser(user user)
        {
            if (user == null) return null;
            return new UserInfo
            {
                FirstName = user.first_name,
                LastName = user.last_name,
                Id = user.uid ?? 0,

            };
        }

    }
}
